from PyQt4 import QtGui, QtCore

from fonttreemodel import FontTreeModel


class FontTreeView(QtGui.QTreeView):
	
	def __init__(self, parent=None, folder=None):
		QtGui.QListView.__init__(self, parent)
		self.model = FontTreeModel(self, folder)
		self.setModel(self.model)
		self.setColumnWidth(0, 20)
		self.setIndentation(0)


	def changeFolder(self, folder):
		#self.model.getFolder(folder)
		#the above crashes
		self.model = FontTreeModel(self, folder)
		self.setModel(self.model)
		self.hide()
		self.show()

	